
using Chaotic.DataBase.DataAccess;

namespace Chaotic.DataBase.SqliteAccess
{
    public class DbTypeEnum : IDbTypeEnum
    {
        public int GetTypeEnum(string? dbType)
        { 
            return dbType?.Trim().ToUpper() switch
            {
                "INT" => Microsoft.Data.Sqlite.SqliteType.Integer.GetHashCode(),
                "BINARY" => Microsoft.Data.Sqlite.SqliteType.Blob.GetHashCode(),
                "TEXT" => Microsoft.Data.Sqlite.SqliteType.Text.GetHashCode(),
                "DECIMAL" => Microsoft.Data.Sqlite.SqliteType.Real.GetHashCode(),
                "FLOAT" => Microsoft.Data.Sqlite.SqliteType.Real.GetHashCode(),
                "DATETIME" => Microsoft.Data.Sqlite.SqliteType.Real.GetHashCode(),
                _ => 0,
            };
        }
    }

}
